//package com.hg.chapter8.jpa.service;
//
//import com.hg.chapter8.jpa.entity.Person;
//import com.hg.chapter8.jpa.repository.CustomerSpecs;
//import com.hg.chapter8.jpa.repository.PersonRepository;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.domain.Page;
//import org.springframework.data.domain.PageRequest;
//import org.springframework.data.domain.Sort;
//import org.springframework.stereotype.Service;
//
//import java.util.List;
//
//@Service
//public class PersonService {
//
//    @Autowired
//    private PersonRepository personRepository;
//
//    public void findPeople(){
//        List<Person> all = personRepository.findAll(CustomerSpecs.personGetName());
//    }
//
//    public void findPeople1(){
//        List<Person> bySex = personRepository.findBySex("man", new Sort(Sort.Direction.ASC, "age"));
//    }
//
//    public void findPeople2(){
//        Page<Person> kobe = personRepository.findByAgeAndName(10, "kobe", PageRequest.of(0,10));
//    }
//
//}
